<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use common\components\CatelogHelper;

/* @var $this yii\web\View */
/* @var $model common\models\Note */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="note-form">

    <?php $form = ActiveForm::begin(); ?>

    <div class="row">
        <div class="col-md-3">
            <?php
            echo $form->field($model, 'cid')->label(YII::t('common', 'Cagelog'))
                    ->dropDownList(ArrayHelper::map(CatelogHelper::CatelogSelect(), 'id', 'title'));
            ?>
        </div>
        <div class="col-md-3">
            <?php
            $arr = [
                ['id' => '1', 'name' => '是'],
                ['id' => '0', 'name' => '否'],
            ];
            ?>
            <?= $form->field($model, 'enabled')->dropDownList(ArrayHelper::map($arr, 'id', 'name')) ?>
        </div>        
    </div>
    <div class="row">
        <div class="col-md-10">    
            <?php echo $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
            <?= $form->field($model, 'author')->textInput(['maxlength' => true, 'value'=> '独步']) ?>
            <?= $form->field($model, 'description')->textarea(array('rows' => 2))->label(Yii::t('common', 'description')) ?>

            <?php
            echo $form->field($model, 'content')->widget('common\widgets\ueditor\Ueditor', [
                'options' => ['initialFrameWidth' => "100%",]
            ])->label(Yii::t('common', 'content'));
            ?>

            <?= $form->field($model, 'tag')->textInput(['maxlength' => true]) ?>

            <div class="form-group">
                <?= Html::submitButton($model->isNewRecord ? Yii::t('common', 'Create') : Yii::t('common', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
            </div>
        </div>
    </div>

    <?php ActiveForm::end(); ?>

</div>
